<script>


export default {
  components: {

  },
  data() {
    return {
    }
  },
  //计算属性
  computed: {
    "menu":{
      get(){
        return this.$store.state.menu;//获取菜单
      }
    }
  },
  //props 父组件向子组件传值
  props: {
    isCollapse: Boolean
  }
}
</script>

<template>
  <el-menu
      active-text-color="#ffd04b"
      background-color="#545c64"
      text-color="#fff"
      default-active="/Home"
      style="height: 100%"
      :collapse="isCollapse"
      :collapse-transition=false
      router
  >
    <el-menu-item index="/Home">
      <i class="el-icon-s-home"></i>
      <template v-slot:title>
        <span>首页</span>
      </template>
    </el-menu-item>

<!--    循环菜单-->
    <el-menu-item :index="'/'+item.menuclick" v-for="(item,i) in menu" :key="i" >
      <i :class="item.menuicon"></i>
      <span slot="title">{{ item.menuname }}</span>
    </el-menu-item>

  </el-menu>
</template>

<style scoped>
</style>